<template>
  <div>
    <HeaderNav title="精彩跟帖" />
    <!-- 每个评论组件显示一条评论 -->
    <CommentMain v-for="comment in commentList" :key="comment.id" :commentData="comment" />
  </div>
</template>

<script>
import HeaderNav from "@/components/HeaderNav";
import CommentMain from "@/components/Comment/Main";
export default {
  components: {
    HeaderNav,
    CommentMain,
  },
  data() {
    return {
      commentList: [],
    };
  },
  created() {
    this.$axios({
      url: "/post_comment/" + this.$route.query.id,
    }).then((res) => {
      const { data } = res.data;
      this.commentList = data;
    });
  },
};
</script>

<style>
</style>